define(function(require, exports, module) {
  var common = require('common'),
      lang = require('lang');

  var View = require('main/admin/core/ItemBox').extend({
    template: require('main/admin/todos/view/item.handlebars'),
    FormView: require('main/admin/todos/form'),
    events: {
      'click .btn-edit': 'onEdit',
      'click .btn-remove': 'onRemove'
    },
    prepareViewData: function() {
      this.viewData = {
        model: this.model.toJSON(),
        label: _.extend(common.todo.label, common.button, {
          timesheet: lang.get('timesheet')
        }),
        owner: this.model.get('owner').objectId === curUser.id
      };
    }
  });

  module.exports = function(options) {
    return ( new View(options) );
  }
});